package ;
import easelhx.display.BitmapAnimation;
import easelhx.display.SpriteSheet;
import easelhx.utils.Ticker;

/**
 * ...
 * @author 
 */

class SpriteSheetSimple extends Example
{

	public function new() 
	{
		super();
	}
	
	override public function run():Void 
	{
		super.run();
		
		// Define a spritesheet. Note that this data was exported by Zoë.
		var ss = new SpriteSheet({
			"animations":
			{
				"run": [0, 25, "jump"],
				"jump": [26, 63, "run"]},
				"images": ["assets/runningGrant.png"],
				"frames":
					{
						"height": 292.5,
						"width":165.75,
						"regX": 0,
						"regY": 0,
						"count": 64
					}
			});

		var grant:BitmapAnimation = new BitmapAnimation(ss);
		grant.x = 360;
		grant.y = 22;

		grant.gotoAndPlay("run");

		// Add Grant to the stage, and add it as a listener to Ticker to get updates each frame.
		stage.addChild(grant);
		Ticker.setFPS(60);
		Ticker.addListener(stage);
	}
	
}